<?php

namespace Morrow;

class PageController extends DefaultController {
	public function run() {
		if(!$this->session->get("uid")){
			$this -> url -> redirect('home');
		}


		@$messenger=$this->session->get("messenger");

        if($messenger){

                $dollar="$";
                $messenger_content ="not difine";

                $messenger_jq="<script>".$dollar."('#messenger').fadeIn('slow');</script>";

                if($messenger=="login1"){
                        $messenger_content="登陆成功！";
                }

                if($messenger=="add1"){
                        $messenger_content="添加Webapp成功,你可以在编辑里面修改你的Webapp！";
                }

                if($messenger=="edit1"){
                        $messenger_content="修改Webapp成功！";
                }

                if($messenger=="changepassword1"){
                        $messenger_content="修改密码成功！";
                }

                if($messenger=="changename1"){
                        $messenger_content="修改用户名成功！";
                }
                if($messenger=="changecontact1"){
                        $messenger_content="修改其他设置成功！";
                }

                $messenger_array=array('jq' => $messenger_jq, 'content' => $messenger_content );


        }
        else{
                $messenger_array=array('jq' => 'no_jq', 'content' => 'no_content' );
        }

        $this->view->setContent($messenger_array, 'messenger');

        $this->session->delete('messenger');

	}
}